

cjson = require "cjson.safe"
local http2tcp = require "http2tcp"
local resp = {
	msg = "ok",
	code = 0 
}

http2tcp:new("127.0.0.1", 9877)
ngx.req.read_body()
local body = ngx.req.get_body_data()
local taskid = 1568
local cmd    = "start"
local is_force = 0

http2tcp:send({taskid=taskid, is_force=is_force, name="", command=cmd, payload=body})

local data = http2tcp:receive()

resp.data = data

ngx.say(cjson.encode(resp))

